From cd0c11419fbb0edea4cdd97c5b05ce4ed970ee40 Mon Sep 17 00:00:00 2001 From: tsteven4 Date: Tue, 7 Jan 2014 23:32:31 +0000 Subject: [PATCH] correct bug introduced to an1 reader wrt url strings. --- gpsbabel/an1.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gpsbabel/an1.cc b/gpsbabel/an1.cc index 2ef6b42f4..80bc8e128 100644 --- a/gpsbabel/an1.cc +++ b/gpsbabel/an1.cc @@ -713,9 +713,13 @@ static void Read_AN1_Waypoints(gbfile* f) wpt_tmp->AddUrlLink(rec->url); } else { int u = wpt_tmp->description.indexOf("{URL="); - QString us = wpt_tmp->description.mid(u); - if (!us.isEmpty()) { - wpt_tmp->AddUrlLink(us); + if (u != -1) { + QString us = wpt_tmp->description.mid(u); + us.remove(0,5); // throw away anything up to and including "{URL=" + us.chop(1); // throw away final character, assumed to be "}" + if (!us.isEmpty()) { + wpt_tmp->AddUrlLink(us); + } } } -- 2.30.2